import request from '@/utils/request'

// 查询前端分类列表
export function getListCategortName () {
  return request({
    url: '/manage/category/getListCategortName',
    method: 'get',
  })
}
// 查询前端分类列表
export function listCategory (query) {
  return request({
    url: '/manage/category/list',
    method: 'get',
    params: query
  })
}

// 查询前端分类详细
export function getCategory (id) {
  return request({
    url: '/manage/category/' + id,
    method: 'get'
  })
}
// 状态修改
export function changeUserStatus (id, opStatus) {
  const data = {
    id,
    opStatus
  }
  return request({
    url: '/manage/category/changeStatus',
    method: 'put',
    data: data
  })
}
// 新增前端分类
export function addCategory (data) {
  return request({
    url: '/manage/category',
    method: 'post',
    data: data
  })
}

// 修改前端分类
export function updateCategory (data) {
  return request({
    url: '/manage/category',
    method: 'put',
    data: data
  })
}

// 删除前端分类
export function delCategory (id) {
  return request({
    url: '/manage/category/' + id,
    method: 'delete'
  })
}
